<?php

namespace App\Mail;

use Illuminate\Bus\Queueable;
use Illuminate\Mail\Mailable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Contracts\Queue\ShouldQueue;

class RepayMoneyMail extends Mailable
{
    use Queueable, SerializesModels;

    private $path;

    /**
     * Create a new message instance.
     *
     * @return void
     */
    public function __construct($path)
    {
        $this->path = $path;
    }

    /**
     * Description: 前一天放款数据邮件
     * Author: zhaiyukang
     * DateTime: 2019-03-13 18:05
     * @return LoanMail
     */
    public function build()
    {
        $date = date('Ymd', strtotime('-1 day'));
        return $this->view('mail.repayment', ['str'=>date('Y年m月d日', strtotime('-1 day')) .'资方还款数据，敬请查收'])->attach($this->path, [
            'as' => $date . '资方还款数据.xlsx'
        ]);
    }
}
